package com.airS.task.fileMgr.utils.page;

import com.airS.task.fileMgr.common.query.PageQuery;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;

/**
 * 分页工具类
 * Created by alan on 2017/3/9.
 */
public class PageUtil {

    /**
     * 开始分页
     * @param query 分页查询对象
     * @return
     */
    public static Page startPage(PageQuery query) {
        Page page = PageHelper.startPage(query.getPageNum(), query.getPageSize());
        page.setRequestUrl(query.getRequestUrl());
        return page;
    }

}
